package org.xxx.epms.admin.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Service;
import org.xxx.epms.admin.models.AdminDetails;
import org.xxx.epms.admin.models.AdminPermission;
import org.xxx.epms.admin.dto.AdminParam;
import org.xxx.epms.admin.models.Admin;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author lb
 * @since 2024-06-08
 */
@Service
public interface AdminService extends IService<Admin> {
    /**
     * 注册
     * @param adminParam AdminParam
     * @return Admin
     */
    Admin register(AdminParam adminParam);

    /**
     * 登录并返回token
     * @param adminParam AdminParam
     * @return String token
     */
    String login(AdminParam adminParam);

    /**
     * 根据adminCode获取管理员信息
     * @param adminCode 管理员编码
     * @return AdminParam
     */
    Admin getAdminByAdminCode(String adminCode);

    List<AdminPermission> getAdminPermissionListByAdminId(int adminId);

    AdminDetails loadUserByUsername(String username);
}
